package cn.itcast.dmp.tags
import org.apache.spark.sql.Row
/**
  * 性别标签(GenderTag)生成
  */
object Tags4GenderMaker extends TagsMaker {
  override def make(row: Row, dic: Map[String, String]): Map[String, Double] = {
    // 获取性别的值
    val genderValue = row.getAs[String]("sex")

    // 计算并返回标签
    genderValue match {
      case "1" => Map(s"GD@男" -> 1.0)
      case "0" => Map(s"GD@女" -> 1.0)
      case _ => Map[String, Double]()
    }
  }
}
